#ifndef TCPCLIENTFORM_H
#define TCPCLIENTFORM_H

#include <QWidget>
#include "InputParameter.h"
#include <QTcpSocket>

namespace Ui {
class TcpClientForm;
}

class TcpClientForm : public QWidget
{
    Q_OBJECT

public:
    explicit TcpClientForm(QWidget *parent = nullptr);
    ~TcpClientForm();

    bool IsOpen(){
        if(this->m_socket && this->m_socket->isOpen()){
            return true;
        }
        return false;
    };


public slots:
    void slot_connect();
    void slot_disconnect();

public:
    void Send(const stParameter& parameter);

signals:
    void SigData(const QByteArray& data);

private:
    Ui::TcpClientForm *ui;

    QTcpSocket* m_socket;
};

#endif // TCPCLIENTFORM_H
